<?php
$id = $_COOKIE['id'] ? $_COOKIE['id'] : 0;
$username = $_COOKIE['username'] ? $_COOKIE['username'] : '';
// var_dump($id);
// var_dump($username);
// exit;

if (empty($id) || empty($username))
{
    ShowMsg('非法访问', 'login.php');
    exit;
}

$sql = "SELECT * FROM `per_admin` WHERE `id` = $id AND `username` = '$username'";
$retlue = find($sql);
if (!$retlue)
{
    ShowMsg('非法访问', 'login.php');
    exit;
}

// 跟新用户存储信息
$_SESSION['admin'] = $retlue;
